package com.david.equipment.mapper;

import com.david.equipment.pojo.entity.FieldEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FieldMapper {

    List<FieldEntity> selectFieldsAll(FieldEntity field);

    @Insert("insert into  equip_field_custom (name, type) values (#{name}, #{type})")
    void insertField(@Param("name") String name,@Param("type") String type);


    List<FieldEntity> selectField(@Param("name") String name,@Param("type") String type);

    @Update("update equip_field_custom set name = #{field.name}, type = #{field.type} where id = #{field.id}")
    void updateField(@Param("field") FieldEntity field);

    @Delete("delete from equip_field_custom where id = #{id}")
    void deleteField(Integer id);
}
